package com.chenyongjing.design.pattern.visitor.general;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author chen
 * @Date 2022/12/7 22:25
 */
public class ObjectStructure {

    private List<IELement> mList = new ArrayList<>();

    {
        this.mList.add(new ConcreteElementA());
        this.mList.add(new ConcreteElementB());
    }

    void accept(IVisitor visitor){
        for (IELement eLement : this.mList){
            eLement.accept(visitor);
        }
    }
}
